package com.yyfax.pay.third.model.to.fuioudeposit;

import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.yyfax.framework.model.BasePO;
import com.yyfax.pay.common.util.XmlUtil;
import com.yyfax.pay.third.model.to.fuiou.ProtocolPlaceOrderRetryFuiouContent;

/**
 * 交易查询结果响应xml实体
 * 
 * @author heizq
 * @date 2017-09-02 16:35:20
 * @since v2.0.0
 */
@SuppressWarnings("serial")
@XStreamAlias("ap")
public class TradeQueryResultXMLRsp extends BasePO {

	private TradePlain plain;

	@XStreamAlias("signature")
	private String sign;

	public TradePlain getPlain() {
		return plain;
	}

	public void setPlain(TradePlain plain) {
		this.plain = plain;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	/**
	 * XML字符串转换成实体{@link ProtocolPlaceOrderRetryFuiouContent}
	 * 
	 * @author heizq
	 * @date 2017-4-12 10:53:28
	 * @since v1.0.0
	 * @param xml
	 * @return 返回{@link ProtocolPlaceOrderRetryFuiouContent}
	 */
	public static TradeQueryResultXMLRsp fromXml(String xml) {
		// QNameMap qmap = new QNameMap();
		// // qmap.setDefaultNamespace("http://www.99bill.com/mas_cnp_merchant_interface");
		// qmap.setDefaultPrefix("");
		// StaxDriver staxDriver = new StaxDriver(qmap);
		// XStream xstream = new XStream(staxDriver);
		// xstream.autodetectAnnotations(true);
		// xstream.ignoreUnknownElements();
		// xstream.alias("ap", TradeQueryResultXMLRsp.class);
		// return (TradeQueryResultXMLRsp) xstream.fromXML(xml);

		return XmlUtil.fromXMLForXStream(xml, "ap", TradeQueryResultXMLRsp.class, "plain", TradePlain.class);
	}

	@XStreamAlias("plain")
	public class TradePlain {
		@JSONField(serialize = false)
		@XStreamAlias("resp_code")
		private String respCode;
		@JSONField(serialize = false)
		@XStreamAlias("mchnt_cd")
		private String merchantId;
		@JSONField(serialize = false)
		@XStreamAlias("mchnt_txn_ssn")
		private String serailNo;
		@JSONField(serialize = false)
		@XStreamAlias("busi_tp")
		private String busiType;

		@XStreamAlias("total_number")
		private String totalNumber;

		@XStreamAlias("results")
		private List<TradeQueryRst> results;

		public String getBusiType() {
			return busiType;
		}

		public void setBusiType(String busiType) {
			this.busiType = busiType;
		}

		public String getTotalNumber() {
			return totalNumber;
		}

		public void setTotalNumber(String totalNumber) {
			this.totalNumber = totalNumber;
		}

		public String getRespCode() {
			return respCode;
		}

		public void setRespCode(String respCode) {
			this.respCode = respCode;
		}

		public String getMerchantId() {
			return merchantId;
		}

		public void setMerchantId(String merchantId) {
			this.merchantId = merchantId;
		}

		public String getSerailNo() {
			return serailNo;
		}

		public void setSerailNo(String serailNo) {
			this.serailNo = serailNo;
		}

		public List<TradeQueryRst> getResults() {
			return results;
		}

		public void setResults(List<TradeQueryRst> results) {
			this.results = results;
		}
	}

	/**
	 * 交易查询结果
	 * 
	 * @author heizq
	 * @date 2017-09-09 14:33:18
	 * @since v1.0.0
	 */
	@XStreamAlias("result")
	public class TradeQueryRst {
		@JSONField(serialize = false)
		@XStreamAlias("ext_tp")
		private String extendType;
		@XStreamAlias("txn_date")
		private String tradeDate;
		@XStreamAlias("txn_time")
		private String tradeTime;
		@XStreamAlias("src_tp")
		private String tradeMethod;
		@XStreamAlias("mchnt_ssn")
		private String busiId;
		@XStreamAlias("txn_amt")
		private String amount;
		@XStreamAlias("txn_amt_suc")
		private String successAmount;
		@XStreamAlias("contract_no")
		private String contractNo;
		@JSONField(serialize = false)
		@XStreamAlias("out_fuiou_acct_no")
		private String outVirtualAccountNo;
		@XStreamAlias("out_cust_no")
		private String outAccountNo;
		@XStreamAlias("out_artif_nm")
		private String outAccountName;
		@JSONField(serialize = false)
		@XStreamAlias("in_fuiou_acct_no")
		private String inVirtualAccountNo;
		@XStreamAlias("in_cust_no")
		private String inAccountNo;
		@XStreamAlias("in_artif_nm")
		private String inAccountName;
		@XStreamAlias("remark")
		private String remark;
		@JSONField(serialize = false)
		@XStreamAlias("txn_rsp_cd")
		private String tradeRespCode;
		@JSONField(serialize = false)
		@XStreamAlias("rsp_cd_desc")
		private String tradeRespDesc;

		private Integer rspCode;
		private String rspMsg;

		public Integer getRspCode() {
			return rspCode;
		}

		public void setRspCode(Integer rspCode) {
			this.rspCode = rspCode;
		}

		public String getRspMsg() {
			return rspMsg;
		}

		public void setRspMsg(String rspMsg) {
			this.rspMsg = rspMsg;
		}

		public String getExtendType() {
			return extendType;
		}

		public void setExtendType(String extendType) {
			this.extendType = extendType;
		}

		public String getTradeDate() {
			return tradeDate;
		}

		public void setTradeDate(String tradeDate) {
			this.tradeDate = tradeDate;
		}

		public String getTradeTime() {
			return tradeTime;
		}

		public void setTradeTime(String tradeTime) {
			this.tradeTime = tradeTime;
		}

		public String getTradeMethod() {
			return tradeMethod;
		}

		public void setTradeMethod(String tradeMethod) {
			this.tradeMethod = tradeMethod;
		}

		public String getBusiId() {
			return busiId;
		}

		public void setBusiId(String busiId) {
			this.busiId = busiId;
		}

		public String getAmount() {
			return amount;
		}

		public void setAmount(String amount) {
			this.amount = amount;
		}

		public String getSuccessAmount() {
			return successAmount;
		}

		public void setSuccessAmount(String successAmount) {
			this.successAmount = successAmount;
		}

		public String getContractNo() {
			return contractNo;
		}

		public void setContractNo(String contractNo) {
			this.contractNo = contractNo;
		}

		public String getOutVirtualAccountNo() {
			return outVirtualAccountNo;
		}

		public void setOutVirtualAccountNo(String outVirtualAccountNo) {
			this.outVirtualAccountNo = outVirtualAccountNo;
		}

		public String getOutAccountNo() {
			return outAccountNo;
		}

		public void setOutAccountNo(String outAccountNo) {
			this.outAccountNo = outAccountNo;
		}

		public String getOutAccountName() {
			return outAccountName;
		}

		public void setOutAccountName(String outAccountName) {
			this.outAccountName = outAccountName;
		}

		public String getInVirtualAccountNo() {
			return inVirtualAccountNo;
		}

		public void setInVirtualAccountNo(String inVirtualAccountNo) {
			this.inVirtualAccountNo = inVirtualAccountNo;
		}

		public String getInAccountNo() {
			return inAccountNo;
		}

		public void setInAccountNo(String inAccountNo) {
			this.inAccountNo = inAccountNo;
		}

		public String getInAccountName() {
			return inAccountName;
		}

		public void setInAccountName(String inAccountName) {
			this.inAccountName = inAccountName;
		}

		public String getRemark() {
			return remark;
		}

		public void setRemark(String remark) {
			this.remark = remark;
		}

		public String getTradeRespCode() {
			return tradeRespCode;
		}

		public void setTradeRespCode(String tradeRespCode) {
			this.tradeRespCode = tradeRespCode;
		}

		public String getTradeRespDesc() {
			return tradeRespDesc;
		}

		public void setTradeRespDesc(String tradeRespDesc) {
			this.tradeRespDesc = tradeRespDesc;
		}
	}
}
